package napier.sadari;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.SlidingDrawer;
import android.widget.TextView;

public class Main extends Activity {
	
	
	Button singleGameBtn;
	Button multiGameBtn;
	Button settingBtn;
	Button helpBtn;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
//        setContentView(R.layout.multi_activity);
        
        singleGameBtn = (Button)findViewById(R.id.singleGameBtn);
        multiGameBtn = (Button)findViewById(R.id.multiGameBtn);
        settingBtn = (Button)findViewById(R.id.settingBtn);
        helpBtn = (Button)findViewById(R.id.helpBtn);

		setBtnAction();
		
		
    }
    
    
	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// TODO Auto-generated method stub
		
		
		TextView tv = (TextView)findViewById(R.id.mainText);
		String text = "a";
		
		if(event.getAction() == MotionEvent.ACTION_DOWN){
			tv.setText("down");
		} else if(event.getAction() == MotionEvent.ACTION_UP){
			tv.setText("up");
		} else if(event.getAction() == MotionEvent.ACTION_MOVE){
			tv.setText("move");
		}
			
		
		return super.onTouchEvent(event);
	}

	
	
	
	
	
	private void setBtnAction(){
		        
		singleGameBtn.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){        		
        		Intent aIntent = new Intent(Main.this, SingleGameActivity.class);        		        		
        		startActivity(aIntent);
        	}
        });
		
		multiGameBtn.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){        		
        		Intent aIntent = new Intent(Main.this, MultiGameActivity.class);        		        		
        		startActivity(aIntent);
        	}
        });
		
		settingBtn.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){        		
        		Intent aIntent = new Intent(Main.this, SettingActivity.class);        		        		
        		startActivity(aIntent);
        	}
        });
		
		helpBtn.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){        		
        		Intent aIntent = new Intent(Main.this, HelpActivity.class);        		        		
        		startActivity(aIntent);
        	}
        });
		
		
	}
	
}







